<?php
<?php
/**
 * @Author: Wherein
 * @Date: 2020-03-01 13:58
 * @Descripttion: 
 */

defined('IN_IA') or exit('Access Denied');
global $_W, $_GPC;

if ($_GPC['do'] != 'webservice') {
    getInfo();
}

//测试数据
//$_W['fans'] = array(
//    'openid' => 'oWA0qv_RGMDCqFOw5tSbjMNpxXog',
//    'nickname' => 'Wherein'
//);

$controller = empty($_GPC['do']) ? 'index' : $_GPC['do'];
$action = empty($_GPC['act']) ? 'index' : $_GPC['act'];

$file = KB_APP . 'controller/' . $controller . '.php';

$controller = ucfirst($controller);

include_once KB_APP . 'controller/base.php';
include_once $file;

if (file_exists($file)) {
    $c = new $controller();
    $c->__set('modulename', $this->modulename);
    $c->__set('weid', $this->weid);
    $c->__set('uniacid', $this->uniacid);
    $c->__set('__define', $this->__define);

    $c->$action();
} else {
    exit("Error: 控制器 '{$file}' 不存在!");
}
